{% extends "mainapp/base.html" %}

{% load static %}
{% load bootstrap %}

{% block title %} 用户信息管理 {% endblock %}


{% block content %}


    <div class="row">
        <div class="col-7"><h4 class="text-left">用户信息管理</h4></div>
        <div class="col-5 text-right">
            <h5><a href="{% url 'add_user' %}" class="btn btn-success mt-4">新增用户</a>
            </h5></div>
    </div>
    <h5 class="mt-4">用户列表</h5>
    <table class="table table-striped mt-4">
        <thead>
        <tr>
            <th>用户名</th>
            <th>角色</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for user in users %}
            <tr>
                <td>{{ user.username }}</td>
                <td>{{ user.get_role_display }}</td>
                <td>
                    <a href="{% url 'change_password' user.id %}" class="btn btn-primary btn-sm">修改信息</a>
                    <a href="{% url 'confirm_delete_user' user.id %}" class="btn btn-danger btn-sm">删除</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

{% endblock %}